import { getWithdrawDetail } from '../../../api/recharge/recharge';

Page({
    data: {
        withdrawDetailList: [],
    },
    onLoad: function (options) {
        getWithdrawDetail().then((res) => {
            console.log(res);
            let tmpWithdrawDetailList = res.data.list;
            if (tmpWithdrawDetailList.length > 0) {
                tmpWithdrawDetailList = tmpWithdrawDetailList.map((item) => {
                    return {
                        date: item.create_time.slice(0, 10),
                        time: item.create_time.slice(10, 19),
                        money: item.redsum,
                    }
                });
                this.setData({
                    withdrawDetailList: tmpWithdrawDetailList,
                });
            }
        }).catch((err) => {
            console.log(err);
        })
    },
    onShow: function () {
    },
    onUnload: function () {
    },
});